<?php

declare(strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */

namespace App\Controller\business;

use App\Kernel\Util\UserJwtInstance;
use App\Middleware\User\UserMiddleware;


use App\Service\User\MoneyService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\Snowflake\IdGeneratorInterface;
use Hyperf\Utils\ApplicationContext;

/**
 * 推荐返点控制器
 * @AutoController()
 * @Middleware(UserMiddleware::class)
 * @author 张昊 (2396675557@qq.com)
 * @package App\Controller\business
 */
class RecommendController extends Controller
{

    /**
     * @Inject
     * @var MoneyService
     */
    public $money_service;

    /**
     * 商家流水
     */
    public function list()
    {

        $start_time = (string)$this->request->input('start_time', '');

        $result = $this->money_service->list($start_time);

        $this->success($result);
    }

    /**
     * 刷新商家金额
     */
    public function test()
    {
        $business_id = (int)$this->request->input('business_id', '');

        $this->money_service->updateMoneyBalance($business_id);

        $this->success();
    }
}